/*
 * Diego Zamboni Latance 			344990
 * Fellipe Augusto Ruiz de Souza 	344796
 * 
 */
package ast;

import java.util.*;

public class ExprList {

	public ExprList() {
		v = new ArrayList<Expr>();
	}

	public void addElement(Expr expr) {
		v.add(expr);
	}

	public void setV(ArrayList<Expr> v) {
		this.v = v;
	}

	public ArrayList<Expr> getV() {
		return v;
	}

	// get element by id
	public Expr getElement(int id) {
		return v.get(id);
	}

	public int size() {
		return v.size();
	}

	public void genC(PW pw) {

		int size = v.size();
		for (Expr e : v) {
			e.genC(pw, false);
			if (--size > 0)
				pw.print(", ");
		}
	}

	public void genKrakatoa(PW pw) {
		int size = v.size();
		for (int i = 0; i < v.size(); i++) {
			v.get(i).genKrakatoa(pw, false);
			if (--size > 0)
				pw.print(", ");
		}
	}

	private ArrayList<Expr> v;

}
